Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: support annotated tags as merge source #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vaab
Copy link

@vaab vaab commented Apr 10, 2019

Avoids also contacting twice (fetch and then pull) remote before merging.

This current proposal is only one commit, and has no proper tests yet (although, it passes all existing test). If you are interested in this proposal, I will be more than happy to add proper tests and make changes to it to comply with any of your requirements.

It might also fall short in some of your basic behavior if they are not covered by tests.

This solves #27 and #28

@vaab vaab force-pushed the master branch 3 times, most recently from d6351da to 54c72e6 Compare April 10, 2019 16:00
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.3%) to 81.618% when pulling 54c72e6 on 0k:master into 8631b0e on acsone:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.3%) to 81.618% when pulling 54c72e6 on 0k:master into 8631b0e on acsone:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.3%) to 81.618% when pulling 54c72e6 on 0k:master into 8631b0e on acsone:master.

@coveralls
Copy link

coveralls commented Apr 10, 2019

Coverage Status

Coverage decreased (-1.3%) to 81.618% when pulling 54c72e6 on 0k:master into 8631b0e on acsone:master.

@vaab
Copy link
Author

vaab commented Apr 10, 2019

As a note: It seems that depth option in the remote might be lost in my code. I'll have an eye on this later.

@lmignon
Copy link
Member

lmignon commented Apr 15, 2019

@vaab Thank you for your proposal. Back from some days off, I'll review your changes and issues in the coming days..

@bealdav
Copy link

bealdav commented May 15, 2020

I don' know if it's possible to reconsider this PR ? Its results are nice.

Thanks

@sbidoul
Copy link
Member

sbidoul commented May 18, 2020

I've done a quick test and this worked for me. The code looks good too.

I'd be enclined to merge this. What do you thing @lmignon? @yajo as you are a heavy user maybe you'd like to test this too?

@lmignon
Copy link
Member

lmignon commented May 19, 2020

I just tested this PR and it worked also for me. It's a lot of refactoring but the code looks good to me.
@vaab It would be nice to have some tests for the new use cases covered by your changes. Sorry for the very long delay, I missed this PR. If you have no time to add tests, we can merge this.

Regards,

lmi

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've found an issue with this PR.

With such a gitaggregate.yml:

./src/odoo:
    remotes:
        odoo: https://github.com/odoo/odoo.git
        origin: ssh://[email protected]/acsone/odoo.git
    merges:
        - odoo 13.0
        - origin 13.0-with-setup
    target: origin 13.0-mybranch

gitaggreagate -c gitaggregate.yml -p produces this error:

(INFO) [14:57:13] git_aggregator.repo  odoo   Push 13.0-mybranch to origin
error: src refspec 13.0-mybranch does not match any
error: failed to push some refs to 'ssh://[email protected]/acsone/odoo.git'
(ERROR) [14:57:13] git_aggregator.repo  odoo   /home/me/odoo-vestibus/src/odoo> error calling ['git', 'push', '-f', 'origin', '13.0-vst_master']
Traceback (most recent call last):
  File "/home/me/git-aggregator/git_aggregator/main.py", line 206, in aggregate_repo
    repo.push()
  File "/home/me/git-aggregator/git_aggregator/repo.py", line 299, in push
    self.log_call(['git', 'push', '-f', remote, branch], cwd=self.cwd)
  File "/home/me/git-aggregator/git_aggregator/repo.py", line 177, in log_call
    ret = callwith(cmd, **kw)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'push', '-f', 'origin', '13.0-mybranch']' returned non-zero exit status 1.

@vaab
Copy link
Author

vaab commented May 22, 2020

Sorry for the delay on my end. And many thanks for all your careful test and review.

I am quite busy now, but will try to find some time this afternoon. No promises. I'm aware that it misses tests and all, but I wasn't sure it was a change that you would accept.

I think it is more than important that some tests are written to be merged along with this PR.

…csone#28)

Avoids also contacting twice (``fetch`` and then ``pull``) remote before
merging.

Signed-off-by: Valentin Lab <[email protected]>
@vaab
Copy link
Author

vaab commented May 23, 2020

I've added 2 tests:

  • one that covers basic reference to annotated tag and that is failing on previous implementation.
  • one that reproduce the issue that @sbidoul found and that involves push behavior

And I made the second test pass to fix the issue that @sbidoul brought up.

May I bring up the fact that my usage of target might break some non-specified behaviors (I mean non-tested behavior as was the push behavior that was failing previously). Behaviors involving pre-existing git repository seem a little strange and untested to me. For instance, I didn't really understand the need of having to specify a target branch when not using a push. This might need some extra check on your side as I might have screwed something.

@yajo
Copy link
Contributor

yajo commented May 25, 2020

If I understand this correctly, the PR affects mainly to the push action, right?

We're not using that, so OK for me.

@sbidoul
Copy link
Member

sbidoul commented Jun 5, 2020

I tested again, works fine now. @vaab can you rebase and suggest a changelog entry? Then I'll cut a release.

@sbidoul
Copy link
Member

sbidoul commented Aug 28, 2020

@vaab could you rebase and propose a changelog entry that summarizes this change?

@vaab
Copy link
Author

vaab commented Aug 29, 2020

Sorry about the delay, I'll be ready to do that starting from the 7th of September. Will that be okay ?
And many thanks for your carefull attention on this PR.

@sbidoul
Copy link
Member

sbidoul commented Aug 30, 2020

@vaab sure, no worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants